/*
 *  DIDPosition.h
 *  libavid
 *
 *  Created by Peter on 26.02.12.
 *  Copyright 2012 __MyCompanyName__. All rights reserved.
 *
 */

#ifndef A_DID_POSITION_H
#define A_DID_POSITION_H

#include "AObject.h"
#include "AvTypes.h"

// THE CLASS NAME MAY BE IDENTIFIED INCORRECTLY!!!
// Version: 1
class AOrigMobRef : public AObject
{
	
public:
	
	A_DECLARE_CLASS( 'ORIG', AOrigMobRef, AObject );
	
	virtual void readFromStream( AStream& str, const AObjDoc& objd );
	virtual void dump( std::ostream& str ) const;
	
	Int32 _mobIdHigh;
	Int32 _mobIdLow;
	
	// MobID PClass Extension
	aafMCMobID_t _mobId;
	
};

// Base classes: AOrigMobRef, Version is 1, PCID 'ORIG'
// Basically, that's the only class listed in Avid's PClass Registry that has a
// MobID-Extension and hasn't already been classified as having additional 
// attributes (which is mostly how we identified them, because the OMF attribute
// name was telling in a way or gave a clue). The Base class for AMSBob doesn't
// have any tell-tale fields besides the MobID (hi+lo+full aaf version via the 
// MobID extension).
// BOTTOM LINE: THIS MAY BE INCORRECT!!!!!
class AMSBob : public AOrigMobRef
{
	
public:
	
	A_DECLARE_CLASS( 'ABOB', AMSBob, AOrigMobRef );
	
	virtual void readFromStream( AStream& str, const AObjDoc& objd );
	virtual void dump( std::ostream& str ) const;
	
	Int32 _sampleNum; // __OMFI:MSBO:sampleNum: 0
	Int32 _length;    // __OMFI:MSBO:length: 6
	Int16 _trkType;   // OMFI:trkt:Track.trkType: 1
	Int16 _trkNum;    // OMFI:trkt:Track.trkLNum: 1
	
};

// Version: 1
class DIDPosition : public AMSBob
{
	
public:
	
	A_DECLARE_CLASS( 'DIDP', DIDPosition, AMSBob );
	
	virtual void readFromStream( AStream& str, const AObjDoc& objd );
	virtual void dump( std::ostream& str ) const;
	
	Int32 _strip;       // 0
	Int64 _offset;      // 0x00060000 0x00000000
	Int64 _byteLength;  // 0x001A5E00 0x00000000
	bool  _sPosInvalid; // False
	
};

#endif /*Inclusion Guard*/